package com.qian.service.ddj.dao;

import com.qian.service.ddj.entity.DdjOrder;
import com.yaowk.service.common.BaseRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderRepository extends BaseRepository<DdjOrder, Integer> {
    @Query(value = "select * from ddj_order where user_id=?1",nativeQuery = true)
    public List<DdjOrder> QueryAllUserOrder(Integer userId);
    @Query(value = "select * from ddj_order where user_id=?1 and pay_type=?2",nativeQuery = true)
    public List<DdjOrder> QueryOrderByUserIdAndPayType(Integer userId , Byte payType);
    @Query(value = "select * from ddj_order where pay_type=?1",nativeQuery = true)
    public List<DdjOrder> QueryOrderByPayType(Byte payType);
    @Query(value = "select * from ddj_order order by id asc",nativeQuery = true)
    public List<DdjOrder> QueryAllOrders();
    @Query(value = "select * from ddj_order where code=?1",nativeQuery = true)
    public List<DdjOrder> QueryOrderByCode(String code);




}
